#include <iostream>

using namespace std;

int arr[150] = {0};

void qsort(int s,int e){
    int i = s;
    int j = e;
    int mid = arr[(i+j) / 2];

    while (i <= j){
        while (arr[i] < mid) i++;
        while (arr[j] > mid) j--;

        if (i <= j){
            int t = arr[i];
            arr[i] = arr[j];
            arr[j] = t;
            i++,j--;
        }

    }
    if (s < j) qsort(s,j);
    if (i < e) qsort(i,e);
}

int main(){
    int n;
    int i;
    int num = 1001;
    int count = 0;

    cin >> n;

    for (i = 0;i < n;i++){
        cin >> arr[i];
    }

    qsort(0,n-1);

    for (i = 0;i < n;i++){
        if (arr[i] != num){
            count ++;
            num = arr[i];
        }
    }

    cout << count << endl;

    for (i = 0;i < n;i++){
        if (arr[i] != num){
            cout << arr[i] << " ";
            num = arr[i];
        }
    }
}